﻿@model EM.OA.Portal.Models.SystemFunctionModels
@{
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
<script type="text/javascript" src="~/Scripts/page/SystemSetting/SystemFunction.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#btnLeft").click(function () {
            var movevalue = $("#lstRight option:selected").text();
            $("#lstLeft").append("<option>" + movevalue + "</option>");
                $("#lstRight option:selected").remove();
        })
        $("#btnRight").click(function () {
            var movevalue = $("#lstLeft option:selected").text();
                $("#lstRight").append("<option>" + movevalue + "</option>");
                $("#lstLeft option:selected").remove();
        })
    })
</script>
<div>
    @*list*@
    <table id="list" class="easyui-datagrid" toolbar="#toolbar">
    </table>
    <div id="toolbar">
        <a href="#" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="add()">增加</a>
        <a href="#" class="easyui-linkbutton" iconcls="icon-edit" plain="true" onclick="edit()">修改</a>
        <a href="#" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="del()">删除</a>
    </div>
    
    @*Detail*@
    <div id="dlg" class="easyui-dialog" style="width: 600px; height: 400px; padding: 10px 20px"
        closed="true" buttons="#dlg-buttons" modal="true" resizable="true">
        <div id="dlg-buttons">
            <a href="#" class="easyui-linkbutton" iconcls="icon-ok" onclick="save()">保存</a>
            <a href="#" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
        </div>
        <form id="fm" method="post">
            @Html.HiddenFor(m => m.FunctionID)
            <table>
                <tr>
                    <td>@Html.LabelFor(m => m.FunctionName)</td>
                    <td>@Html.TextBoxFor(m => m.FunctionName, new { @class = "easyui-validatebox", @Required = "true", @validType = "length[1,150]" })</td>
                    <td>@Html.LabelFor(m => m.FunctionParentID)</td>
                    <td>
                        <input type="hidden" id="FunctionParentID" name="FunctionParentID" />
                        <input id="comb_FunctionParentName" class="easyui-combotree"
                            data-options="url:'/SystemFunction/GetTreeList',required:true,
                        onSelect: function(rec){  
                            $('#FunctionParentID').val(rec.id); }" />
                    </td>
                </tr>
                <tr>
                    <td>@Html.LabelFor(m => m.Sort)</td>
                    <td><input name="Sort" class="easyui-numberbox" data-options="min:0,max:100" /></td>
                    <td>@Html.Label("功能路径")</td>
                    <td>@Html.TextBoxFor(m => m.FunctionUrl, new { @class = "easyui-validatebox", @Required = "true", @validType = "length[1,150]" })</td>
                </tr>
                <tr>
                    <td>@Html.LabelFor(m => m.FunctionDescription)</td>
                    <td colspan="2"><input name="FunctionDescription" class="easyui-validatebox" data-options="required:true,validType:'length[1,1000]'"></td>
                </tr>
                <tr>
                    <td style="vertical-align:top;">@Html.Label("待选页面：")</td>
                    <td>
                        <div style="height:20px;">
                         @Html.TextBoxFor(m=>m.FunctionName, new {style="width:98px" })
                        <a href="#" class="easyui-linkbutton" iconcls="icon-search" plain="true">查询</a>
                        </div>
                        @Html.ListBox("lstLeft", new SelectList(new EM.OA.Portal.Models.SystemFunctionModels().GetPageListItems(), "Value", "Text"), new { style="width:153px;height:180px"})
                    </td>
                    <td>
                        <input type="button" id="btnRight" value=">>" />
                        <br /><br />
                        <input type="button" id="btnLeft" value="<<" />
                    </td>
                    <td>
                        <div style="height:20px;"></div>
                        @Html.ListBox("lstRight", new SelectList(new EM.OA.Portal.Models.SystemFunctionModels().GetPageListItems(), "Value", "Text"), new { style="width:153px;height:180px"})
                    </td>
                </tr>
            </table>
        </form>
    </div>

</div>